/********************************************************************
FileName    :   Dal_yw_dcdH.cs
CreateTime  :   2015-09-18 12:09
BaseClass   :   Dal_yw_dcdH
FileType    :   .cs
Author      :  minjie
Description :   Dal_yw_dcdHDAL层（简单三层）
*********************************************************************/

using System;
using System.Text;
using System.Data.SqlClient;
using System.Collections.Generic;

using System.Data;
namespace OS.DAL
{
	/// <summary>
	/// Dal_yw_dcdH的摘要说明。
	/// </summary>
	public partial class Dal_yw_dcdH 
  	{ 
     		      
  		public bool Exists(int DjLsh) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select count(1) from yw_dcdH");
            strSql.Append(" where DjLsh=@DjLsh"); 
           SqlParameter[] parameters = { new SqlParameter("@DjLsh", SqlDbType.Int,4)};
           parameters[0].Value = DjLsh;
  			return DbHelperSQL.Exists(strSql.ToString(),parameters); 
  		} 
  		 
  				 
  		 
  		/// <summary> 
  		/// 增加一条数据 
  		/// </summary> 
  		public  bool  Add(yw_dcdH_Entity model) 
  		{
            if (model.DjLsh == null)
            {
                model.DjLsh = 0;
            }
            if (model.DjBtZdh == null)
            {
                model.DjBtZdh = 0;
            }
            if (model.DjFtZdh == null)
            {
                model.DjFtZdh = 0;
            }
            if (model.DjStZdh == null)
            {
                model.DjStZdh = 0;
            }
            if (model.DjState == null)
            {
                model.DjState = "";
            }
            if (model.DjCount == null)
            {
                model.DjCount = 0;
            }
            if (model.djzt == null)
            {
                model.djzt = "";
            }
            if (model.dcdh == null)
            {
                model.dcdh = "";
            }
            if (model.dcbmmc == null)
            {
                model.dcbmmc = "";
            }
            if (model.dcbmh == null)
            {
                model.dcbmh = "";
            }
            if (model.drbmmc == null)
            {
                model.drbmmc = "";
            }
            if (model.drbmh == null)
            {
                model.drbmh = "";
            }
            if (model.drckbh == null)
            {
                model.drckbh = "";
            }
            if (model.drckmc == null)
            {
                model.drckmc = "";
            }
            if (model.dcckbh == null)
            {
                model.dcckbh = "";
            }
            if (model.dcckmc == null)
            {
                model.dcckmc = "";
            }
            if (model.bz == null)
            {
                model.bz = "";
            }
            if (model.slhj == null)
            {
                model.slhj = 0;
            }
            if (model.jehj == null)
            {
                model.jehj = 0;
            }
            if (model.jjjehj == null)
            {
                model.jjjehj = 0;
            }
            if (model.zdr == null)
            {
                model.zdr = "";
            }
            if (model.shr == null)
            {
                model.shr = "";
            } 

  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("insert into yw_dcdH(");			 
  	strSql.Append("DjLsh,DjBtZdh,DjFtZdh,DjStZdh,DjState,DjCount,dbrq,djzt,dcdh,dcbmmc,dcbmh,drbmmc,drbmh,drckbh,drckmc,dcckbh,dcckmc,bz,slhj,jehj,jjjehj,zdr,zdsj,shr,shsj) values ("); 
  	strSql.Append("	@DjLsh,@DjBtZdh,@DjFtZdh,@DjStZdh,@DjState,@DjCount,@dbrq,@djzt,@dcdh,@dcbmmc,@dcbmh,@drbmmc,@drbmh,@drckbh,@drckmc,@dcckbh,@dcckmc,@bz,@slhj,@jehj,@jjjehj,@zdr,@zdsj,@shr,@shsj	 ) "); 
  			SqlParameter[] parameters = { 
              new SqlParameter("@DjLsh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjBtZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjFtZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjStZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjState", SqlDbType.Char,10) ,              
              new SqlParameter("@DjCount", SqlDbType.Int,4) ,              
              new SqlParameter("@dbrq", SqlDbType.DateTime) ,              
              new SqlParameter("@djzt", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dcdh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dcbmmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dcbmh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@drbmmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@drbmh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@drckbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@drckmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dcckbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dcckmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@bz", SqlDbType.VarChar,50) ,              
              new SqlParameter("@slhj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@jehj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@jjjehj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@zdr", SqlDbType.VarChar,50) ,              
              new SqlParameter("@zdsj", SqlDbType.DateTime) ,              
              new SqlParameter("@shr", SqlDbType.VarChar,50) ,              
              new SqlParameter("@shsj", SqlDbType.DateTime)};             
              parameters[0].Value = model.DjLsh;  
              
              parameters[1].Value = model.DjBtZdh;  
              
              parameters[2].Value = model.DjFtZdh;  
              
              parameters[3].Value = model.DjStZdh;  
              
           if (model.DjState != null)  
              parameters[4].Value = model.DjState;  
           else  
              parameters[4].Value = DBNull.Value;  
              
              parameters[5].Value = model.DjCount;  
              
           if (model.dbrq != null)  
              parameters[6].Value = model.dbrq;  
           else  
              parameters[6].Value = DBNull.Value;  
              
           if (model.djzt != null)  
              parameters[7].Value = model.djzt;  
           else  
              parameters[7].Value = DBNull.Value;  
              
           if (model.dcdh != null)  
              parameters[8].Value = model.dcdh;  
           else  
              parameters[8].Value = DBNull.Value;  
              
           if (model.dcbmmc != null)  
              parameters[9].Value = model.dcbmmc;  
           else  
              parameters[9].Value = DBNull.Value;  
              
           if (model.dcbmh != null)  
              parameters[10].Value = model.dcbmh;  
           else  
              parameters[10].Value = DBNull.Value;  
              
           if (model.drbmmc != null)  
              parameters[11].Value = model.drbmmc;  
           else  
              parameters[11].Value = DBNull.Value;  
              
           if (model.drbmh != null)  
              parameters[12].Value = model.drbmh;  
           else  
              parameters[12].Value = DBNull.Value;  
              
           if (model.drckbh != null)  
              parameters[13].Value = model.drckbh;  
           else  
              parameters[13].Value = DBNull.Value;  
              
           if (model.drckmc != null)  
              parameters[14].Value = model.drckmc;  
           else  
              parameters[14].Value = DBNull.Value;  
              
           if (model.dcckbh != null)  
              parameters[15].Value = model.dcckbh;  
           else  
              parameters[15].Value = DBNull.Value;  
              
           if (model.dcckmc != null)  
              parameters[16].Value = model.dcckmc;  
           else  
              parameters[16].Value = DBNull.Value;  
              
           if (model.bz != null)  
              parameters[17].Value = model.bz;  
           else  
              parameters[17].Value = DBNull.Value;  
              
           if (model.slhj != null)  
              parameters[18].Value = model.slhj;  
           else  
              parameters[18].Value = DBNull.Value;  
              
           if (model.jehj != null)  
              parameters[19].Value = model.jehj;  
           else  
              parameters[19].Value = DBNull.Value;  
              
           if (model.jjjehj != null)  
              parameters[20].Value = model.jjjehj;  
           else  
              parameters[20].Value = DBNull.Value;  
              
           if (model.zdr != null)  
              parameters[21].Value = model.zdr;  
           else  
              parameters[21].Value = DBNull.Value;  
              
           if (model.zdsj != null)  
              parameters[22].Value = model.zdsj;  
           else  
              parameters[22].Value = DBNull.Value;  
              
           if (model.shr != null)  
              parameters[23].Value = model.shr;  
           else  
              parameters[23].Value = DBNull.Value;  
              
           if (model.shsj != null)  
              parameters[24].Value = model.shsj;  
           else  
              parameters[24].Value = DBNull.Value;  
              
  			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);			 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
              return false;; 
           }  
  		} 
  		 
  		/// <summary> 
  		/// 增加一条数据(字符串) 
  		/// </summary> 
  		public  string  AddStr(yw_dcdH_Entity model) 
  		{ 
  				if(model.DjLsh==null) 
  				{ 
  					model.DjLsh=0; 
  				} 
  				if(model.DjBtZdh==null) 
  				{ 
  					model.DjBtZdh=0; 
  				} 
  				if(model.DjFtZdh==null) 
  				{ 
  					model.DjFtZdh=0; 
  				} 
  				if(model.DjStZdh==null) 
  				{ 
  					model.DjStZdh=0; 
  				} 
  				if(model.DjState==null) 
  				{ 
  					model.DjState="";  
  				} 
  				if(model.DjCount==null) 
  				{ 
  					model.DjCount=0; 
  				} 
  				if(model.djzt==null) 
  				{ 
  					model.djzt="";  
  				} 
  				if(model.dcdh==null) 
  				{ 
  					model.dcdh="";  
  				} 
  				if(model.dcbmmc==null) 
  				{ 
  					model.dcbmmc="";  
  				} 
  				if(model.dcbmh==null) 
  				{ 
  					model.dcbmh="";  
  				} 
  				if(model.drbmmc==null) 
  				{ 
  					model.drbmmc="";  
  				} 
  				if(model.drbmh==null) 
  				{ 
  					model.drbmh="";  
  				} 
  				if(model.drckbh==null) 
  				{ 
  					model.drckbh="";  
  				} 
  				if(model.drckmc==null) 
  				{ 
  					model.drckmc="";  
  				} 
  				if(model.dcckbh==null) 
  				{ 
  					model.dcckbh="";  
  				} 
  				if(model.dcckmc==null) 
  				{ 
  					model.dcckmc="";  
  				} 
  				if(model.bz==null) 
  				{ 
  					model.bz="";  
  				} 
  				if(model.slhj==null) 
  				{ 
  					model.slhj=0; 
  				} 
  				if(model.jehj==null) 
  				{ 
  					model.jehj=0; 
  				} 
  				if(model.jjjehj==null) 
  				{ 
  					model.jjjehj=0; 
  				} 
  				if(model.zdr==null) 
  				{ 
  					model.zdr="";  
  				} 
  				if(model.shr==null) 
  				{ 
  					model.shr="";  
  				} 
  		 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("insert into yw_dcdH(");			 
  	strSql.Append("DjLsh,DjBtZdh,DjFtZdh,DjStZdh,DjState,DjCount,dbrq,djzt,dcdh,dcbmmc,dcbmh,drbmmc,drbmh,drckbh,drckmc,dcckbh,dcckmc,bz,slhj,jehj,jjjehj,zdr,zdsj,shr,shsj) values ("); 
  	strSql.Append("	"+ model.DjLsh+","+ model.DjBtZdh+","+ model.DjFtZdh+","+ model.DjStZdh+",'"+ model.DjState+"',"+ model.DjCount+",'"+ model.dbrq+"','"+ model.djzt+"','"+ model.dcdh+"','"+ model.dcbmmc+"','"+ model.dcbmh+"','"+ model.drbmmc+"','"+ model.drbmh+"','"+ model.drckbh+"','"+ model.drckmc+"','"+ model.dcckbh+"','"+ model.dcckmc+"','"+ model.bz+"',"+ model.slhj+","+ model.jehj+","+ model.jjjehj+",'"+ model.zdr+"','"+ model.zdsj+"','"+ model.shr+"','" +model.shsj+"'	 ) "); 
           return strSql.ToString(); 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 更新一条数据 
  		/// </summary> 
  		public bool Update(yw_dcdH_Entity model) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("update yw_dcdH set "); 
              strSql.Append(" DjLsh = @DjLsh,"); 
              strSql.Append(" DjBtZdh = @DjBtZdh,"); 
              strSql.Append(" DjFtZdh = @DjFtZdh,"); 
              strSql.Append(" DjStZdh = @DjStZdh,"); 
              strSql.Append(" DjState = @DjState,"); 
              strSql.Append(" DjCount = @DjCount,"); 
              strSql.Append(" dbrq = @dbrq,"); 
              strSql.Append(" djzt = @djzt,"); 
              strSql.Append(" dcdh = @dcdh,"); 
              strSql.Append(" dcbmmc = @dcbmmc,"); 
              strSql.Append(" dcbmh = @dcbmh,"); 
              strSql.Append(" drbmmc = @drbmmc,"); 
              strSql.Append(" drbmh = @drbmh,"); 
              strSql.Append(" drckbh = @drckbh,"); 
              strSql.Append(" drckmc = @drckmc,"); 
              strSql.Append(" dcckbh = @dcckbh,"); 
              strSql.Append(" dcckmc = @dcckmc,"); 
              strSql.Append(" bz = @bz,"); 
              strSql.Append(" slhj = @slhj,"); 
              strSql.Append(" jehj = @jehj,"); 
              strSql.Append(" jjjehj = @jjjehj,"); 
              strSql.Append(" zdr = @zdr,"); 
              strSql.Append(" zdsj = @zdsj,"); 
              strSql.Append(" shr = @shr,"); 
              strSql.Append(" shsj = @shsj"); 
  			strSql.Append(" where  DjLsh=@DjLsh "); 
  						 
  SqlParameter[] parameters = { 
              new SqlParameter("@DjLsh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjBtZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjFtZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjStZdh", SqlDbType.Int,4) ,              
              new SqlParameter("@DjState", SqlDbType.Char,10) ,              
              new SqlParameter("@DjCount", SqlDbType.Int,4) ,              
              new SqlParameter("@dbrq", SqlDbType.DateTime) ,              
              new SqlParameter("@djzt", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dcdh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dcbmmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dcbmh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@drbmmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@drbmh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@drckbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@drckmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dcckbh", SqlDbType.VarChar,50) ,              
              new SqlParameter("@dcckmc", SqlDbType.VarChar,50) ,              
              new SqlParameter("@bz", SqlDbType.VarChar,50) ,              
              new SqlParameter("@slhj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@jehj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@jjjehj", SqlDbType.Decimal,9) ,              
              new SqlParameter("@zdr", SqlDbType.VarChar,50) ,              
              new SqlParameter("@zdsj", SqlDbType.DateTime) ,              
              new SqlParameter("@shr", SqlDbType.VarChar,50) ,              
              new SqlParameter("@shsj", SqlDbType.DateTime)};             
              parameters[0].Value = model.DjLsh;  
              
              parameters[1].Value = model.DjBtZdh;  
              
              parameters[2].Value = model.DjFtZdh;  
              
              parameters[3].Value = model.DjStZdh;  
              
           if (model.DjState != null)  
              parameters[4].Value = model.DjState;  
           else  
              parameters[4].Value = DBNull.Value;  
              
              parameters[5].Value = model.DjCount;  
              
           if (model.dbrq != null)  
              parameters[6].Value = model.dbrq;  
           else  
              parameters[6].Value = DBNull.Value;  
              
           if (model.djzt != null)  
              parameters[7].Value = model.djzt;  
           else  
              parameters[7].Value = DBNull.Value;  
              
           if (model.dcdh != null)  
              parameters[8].Value = model.dcdh;  
           else  
              parameters[8].Value = DBNull.Value;  
              
           if (model.dcbmmc != null)  
              parameters[9].Value = model.dcbmmc;  
           else  
              parameters[9].Value = DBNull.Value;  
              
           if (model.dcbmh != null)  
              parameters[10].Value = model.dcbmh;  
           else  
              parameters[10].Value = DBNull.Value;  
              
           if (model.drbmmc != null)  
              parameters[11].Value = model.drbmmc;  
           else  
              parameters[11].Value = DBNull.Value;  
              
           if (model.drbmh != null)  
              parameters[12].Value = model.drbmh;  
           else  
              parameters[12].Value = DBNull.Value;  
              
           if (model.drckbh != null)  
              parameters[13].Value = model.drckbh;  
           else  
              parameters[13].Value = DBNull.Value;  
              
           if (model.drckmc != null)  
              parameters[14].Value = model.drckmc;  
           else  
              parameters[14].Value = DBNull.Value;  
              
           if (model.dcckbh != null)  
              parameters[15].Value = model.dcckbh;  
           else  
              parameters[15].Value = DBNull.Value;  
              
           if (model.dcckmc != null)  
              parameters[16].Value = model.dcckmc;  
           else  
              parameters[16].Value = DBNull.Value;  
              
           if (model.bz != null)  
              parameters[17].Value = model.bz;  
           else  
              parameters[17].Value = DBNull.Value;  
              
           if (model.slhj != null)  
              parameters[18].Value = model.slhj;  
           else  
              parameters[18].Value = DBNull.Value;  
              
           if (model.jehj != null)  
              parameters[19].Value = model.jehj;  
           else  
              parameters[19].Value = DBNull.Value;  
              
           if (model.jjjehj != null)  
              parameters[20].Value = model.jjjehj;  
           else  
              parameters[20].Value = DBNull.Value;  
              
           if (model.zdr != null)  
              parameters[21].Value = model.zdr;  
           else  
              parameters[21].Value = DBNull.Value;  
              
           if (model.zdsj != null)  
              parameters[22].Value = model.zdsj;  
           else  
              parameters[22].Value = DBNull.Value;  
              
           if (model.shr != null)  
              parameters[23].Value = model.shr;  
           else  
              parameters[23].Value = DBNull.Value;  
              
           if (model.shsj != null)  
              parameters[24].Value = model.shsj;  
           else  
              parameters[24].Value = DBNull.Value;  
              
              int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
  				return false; 
  			} 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 删除一条数据 
  		/// </summary> 
  		public bool Delete(int  DjLsh) 
  		{ 
  			 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("delete from yw_dcdH "); 
  			strSql.Append(" where  DjLsh=@DjLsh"); 
  			SqlParameter[] parameters = {  new SqlParameter("@DjLsh", SqlDbType.Int,4) };  
    parameters[0].Value = DjLsh;  
   
  			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters); 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
  				return false; 
  			} 
  		} 
  		 
  		/// <summary> 
  		/// 批量删除一批数据 
  		/// </summary> 
  		public bool DeleteList(string DjLshlist ) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("delete from yw_dcdH "); 
  			strSql.Append(" where ID in ("+DjLshlist + ")  "); 
  			int rows=DbHelperSQL.ExecuteSql(strSql.ToString()); 
  			if (rows > 0) 
  			{ 
  				return true; 
  			} 
  			else 
  			{ 
  				return false; 
  			} 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 得到一个对象实体 
  		/// </summary> 
  		public yw_dcdH_Entity GetModel(int   DjLsh) 
  		{ 
  			 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select  DjLsh,DjBtZdh,DjFtZdh,DjStZdh,DjState,DjCount,dbrq,djzt,dcdh,dcbmmc,dcbmh,drbmmc,drbmh,drckbh,drckmc,dcckbh,dcckmc,bz,slhj,jehj,jjjehj,zdr,zdsj,shr,shsj");	
		strSql.Append("  from yw_dcdH"); 
  			strSql.Append(" where  DjLsh=@DjLsh "); 
  			SqlParameter[] parameters = {  new SqlParameter("@DjLsh", SqlDbType.Int,4) };  
    parameters[0].Value = DjLsh;  
  			 
  			yw_dcdH_Entity model=new yw_dcdH_Entity(); 
  			DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters); 
  			 
  			if(ds!=null&&ds.Tables[0].Rows.Count>0) 
  			{ 
  		DataTable dt=ds.Tables[0];	  
  				if(dt.Rows[0]["DjLsh"]!=null&&dt.Rows[0]["DjLsh"].ToString()!="") 
  				{ 
  					model.DjLsh=int.Parse(dt.Rows[0]["DjLsh"].ToString()); 
  				} 
  				if(dt.Rows[0]["DjBtZdh"]!=null&&dt.Rows[0]["DjBtZdh"].ToString()!="") 
  				{ 
  					model.DjBtZdh=int.Parse(dt.Rows[0]["DjBtZdh"].ToString()); 
  				} 
  				if(dt.Rows[0]["DjFtZdh"]!=null&&dt.Rows[0]["DjFtZdh"].ToString()!="") 
  				{ 
  					model.DjFtZdh=int.Parse(dt.Rows[0]["DjFtZdh"].ToString()); 
  				} 
  				if(dt.Rows[0]["DjStZdh"]!=null&&dt.Rows[0]["DjStZdh"].ToString()!="") 
  				{ 
  					model.DjStZdh=int.Parse(dt.Rows[0]["DjStZdh"].ToString()); 
  				} 
  				model.DjState= dt.Rows[0]["DjState"].ToString(); 
  				if(dt.Rows[0]["DjCount"]!=null&&dt.Rows[0]["DjCount"].ToString()!="") 
  				{ 
  					model.DjCount=int.Parse(dt.Rows[0]["DjCount"].ToString()); 
  				} 
  				if(dt.Rows[0]["dbrq"]!=null&&dt.Rows[0]["dbrq"].ToString()!="") 
  				{ 
  					model.dbrq=DateTime.Parse(dt.Rows[0]["dbrq"].ToString()); 
  				} 
  				model.djzt= dt.Rows[0]["djzt"].ToString(); 
  				model.dcdh= dt.Rows[0]["dcdh"].ToString(); 
  				model.dcbmmc= dt.Rows[0]["dcbmmc"].ToString(); 
  				model.dcbmh= dt.Rows[0]["dcbmh"].ToString(); 
  				model.drbmmc= dt.Rows[0]["drbmmc"].ToString(); 
  				model.drbmh= dt.Rows[0]["drbmh"].ToString(); 
  				model.drckbh= dt.Rows[0]["drckbh"].ToString(); 
  				model.drckmc= dt.Rows[0]["drckmc"].ToString(); 
  				model.dcckbh= dt.Rows[0]["dcckbh"].ToString(); 
  				model.dcckmc= dt.Rows[0]["dcckmc"].ToString(); 
  				model.bz= dt.Rows[0]["bz"].ToString(); 
  				if(dt.Rows[0]["slhj"]!=null&&dt.Rows[0]["slhj"].ToString()!="") 
  				{ 
  					model.slhj=decimal.Parse(dt.Rows[0]["slhj"].ToString()); 
  				} 
  				if(dt.Rows[0]["jehj"]!=null&&dt.Rows[0]["jehj"].ToString()!="") 
  				{ 
  					model.jehj=decimal.Parse(dt.Rows[0]["jehj"].ToString()); 
  				} 
  				if(dt.Rows[0]["jjjehj"]!=null&&dt.Rows[0]["jjjehj"].ToString()!="") 
  				{ 
  					model.jjjehj=decimal.Parse(dt.Rows[0]["jjjehj"].ToString()); 
  				} 
  				model.zdr= dt.Rows[0]["zdr"].ToString(); 
  				if(dt.Rows[0]["zdsj"]!=null&&dt.Rows[0]["zdsj"].ToString()!="") 
  				{ 
  					model.zdsj=DateTime.Parse(dt.Rows[0]["zdsj"].ToString()); 
  				} 
  				model.shr= dt.Rows[0]["shr"].ToString(); 
  				if(dt.Rows[0]["shsj"]!=null&&dt.Rows[0]["shsj"].ToString()!="") 
  				{ 
  					model.shsj=DateTime.Parse(dt.Rows[0]["shsj"].ToString()); 
  				} 
  				return model; 
  			} 
  			else 
  			{ 
  				return null; 
  			} 
  		} 
  		 
  		/// <summary> 
  		/// 分页获取数据列表 
  		/// </summary> 
  		public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  		 strSql.Append("SELECT * FROM ( "); 
  		 strSql.Append(" SELECT ROW_NUMBER() OVER ("); 
  if (!string.IsNullOrEmpty(orderby.Trim())) 
 { 
    strSql.Append("order by T." + orderby); 
 } 
else  
 { 
     strSql.Append("order by T.DjLsh desc"); 
 } 
		 strSql.Append(")AS Row, T.*  from yw_dcdH T "); 
  		 if (!string.IsNullOrEmpty(strWhere.Trim()))  
  			{ 
  			 strSql.Append(" WHERE " + strWhere); 
  			} 
  		    strSql.Append(" ) TT"); 
  	        strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);			return DbHelperSQL.Query(strSql.ToString()); 
  		} 
  		 
  		 
  		/// <summary> 
  		/// 获得数据列表 
  		/// </summary> 
  		public DataSet GetList(string strWhere) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select * "); 
  			strSql.Append(" FROM yw_dcdH "); 
  			if(strWhere.Trim()!="") 
  			{ 
  				strSql.Append(" where "+strWhere); 
  			} 
  			return DbHelperSQL.Query(strSql.ToString()); 
  		} 
  		 
  		/// <summary> 
  		/// 获得前几行数据 
  		/// </summary> 
  		public DataSet GetList(int Top,string strWhere,string filedOrder) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select "); 
  			if(Top>0) 
  			{ 
  				strSql.Append(" top "+Top.ToString()); 
  			} 
  			strSql.Append(" * "); 
  			strSql.Append(" FROM yw_dcdH "); 
  			if(strWhere.Trim()!="") 
  			{ 
  				strSql.Append(" where "+strWhere); 
  			} 
  			strSql.Append(" order by " + filedOrder); 
  			return DbHelperSQL.Query(strSql.ToString()); 
  		} 
  		 
  		/// <summary> 
  		/// 获得记录条数 
  		/// </summary> 
  		public int GetRecordCount(string strWhere) 
  		{ 
  			StringBuilder strSql=new StringBuilder(); 
  			strSql.Append("select count(1) "); 
  			strSql.Append(" FROM yw_dcdH "); 
  			if(strWhere.Trim()!="") 
  			{ 
  				strSql.Append(" where "+strWhere); 
  			} 
  		   object obj=	DbHelperSQL.GetSingle(strSql.ToString()); 
  			if(obj!=null && obj.ToString()!="") 
  			{ 
              	return Convert.ToInt32(obj); 
  			} 
  			else 
  			return 0; 
  		} 
   
      
  	} 
  
}
